package org.csu.jpetstore.vo;

import lombok.Data;

import java.math.BigDecimal;
import java.sql.Date;

@Data
public class OrderFormVO {
    private Integer orderId;
    private String userId;
    private java.sql.Date orderDate;// 后端生成
    private String shipProvince;
    private String shipCity;
    private String shipCounty;
    private String shipDetailAddress;
    private BigDecimal totalPrice;// 后端计算
    private String shipToFirstname;
    private String shipToLastname;

    public OrderFormVO() {

    }

    /**
     * 前端提供的参数,没有orderId,orderDate,totalPrice
     *
     * @author huangzhangyan
     * @date 2022/4/24 14:11
     */
    public OrderFormVO(String userId, String shipProvince, String shipCity, String shipCounty,
                       String shipDetailAddress, String shipToFirstname, String shipToLastname) {
        this.userId = userId;

        this.orderDate = new Date(System.currentTimeMillis());
        this.shipProvince = shipProvince;
        this.shipCity = shipCity;
        this.shipCounty = shipCounty;
        this.shipDetailAddress = shipDetailAddress;
        this.shipToFirstname = shipToFirstname;
        this.shipToLastname = shipToLastname;
    }
}
